package TCPUDP;

import java.io.*;
import java.net.Socket;

public class Client {

    public static void main(String[] args) throws IOException {

        Socket socket = new Socket("127.0.0.1",10000);

        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("C:\\Users\\AW\\Desktop\\1.jpg"));

        OutputStream os =socket.getOutputStream();
        BufferedOutputStream bos = new BufferedOutputStream(os);
        int b;
        while((b=bis.read())!=-1){
               bos.write(b);

        }
        bos.flush();
        socket.shutdownOutput();

        BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));

        String line;

        while((line=br.readLine())!=null){
            System.out.print(line);
        }

        br.close();
        socket.close();




    }
}
